package main

import (
	pb "cap-imooc/proto/cap"
	"context"
	"fmt"

	micro "github.com/micro/go-micro"
)

func main() {
	// 创建新服务
	service := micro.NewService(micro.Name("cap.imooc.client"))
	// 初始化
	service.Init()

	capImooc := pb.NewCapService("cap.imooc.server", service.Client())

	res, err := capImooc.SayHello(context.TODO(), &pb.SayRequest{Message: "跟着我学习我微服务"})

	if err != nil {
		fmt.Println(err)
	}
	fmt.Println(res.Answer)
}
